
public class getFinalXSLstring {

	public String finalXSL;
	
	public getFinalXSLstring(String resultVariables, String resultXSL, String usedFunctions) {
		
		final String xmlHeader = 
				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
				"<xsl:stylesheet version=\"2.0\" " +
				"xmlns:fn=\"http://www.w3.org/2005/xpath-functions\" " +
				"xmlns:mismo=\"http://www.mismo.org/residential/2009/schemas\" " +
				"xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" " +
				"xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">" +
				"<xsl:output method=\"xml\" version=\"1.0\" encoding=\"UTF-8\" indent=\"yes\"/>";
		
		final String templateMatching = 
				"<xsl:template match=\"/\">" + 
				"<AllMappings>" +
				"<xsl:apply-templates select=\"ApVariables\"/>" +
				"</AllMappings>" + 
				"</xsl:template>" +
				"<!-- Match ApVariables Template -->" +
				"<xsl:template match=\"ApVariables\">" + 
				"<Mapping>";
		
		final String xmlFooter = "</Mapping>" + "</xsl:template>" + "</xsl:stylesheet>";

		finalXSL = 
				xmlHeader + 
				"<!-- Functions -->" + 
				usedFunctions + 
				templateMatching + 
				resultVariables +
				resultXSL +
				xmlFooter; 
	}


}
